package com.zdj.data.entity;

import android.database.sqlite.SQLiteDatabase;

import java.util.Map;

import de.greenrobot.dao.AbstractDao;
import de.greenrobot.dao.AbstractDaoSession;
import de.greenrobot.dao.identityscope.IdentityScopeType;
import de.greenrobot.dao.internal.DaoConfig;

import com.zdj.data.entity.Note;
import com.zdj.data.entity.Customer;
import com.zdj.data.entity.Order;
import com.zdj.data.entity.User;
import com.zdj.data.entity.HomePageData;
import com.zdj.data.entity.LoginInfo;

import com.zdj.data.entity.NoteDao;
import com.zdj.data.entity.CustomerDao;
import com.zdj.data.entity.OrderDao;
import com.zdj.data.entity.UserDao;
import com.zdj.data.entity.HomePageDataDao;
import com.zdj.data.entity.LoginInfoDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see de.greenrobot.dao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig noteDaoConfig;
    private final DaoConfig customerDaoConfig;
    private final DaoConfig orderDaoConfig;
    private final DaoConfig userDaoConfig;
    private final DaoConfig homePageDataDaoConfig;
    private final DaoConfig loginInfoDaoConfig;

    private final NoteDao noteDao;
    private final CustomerDao customerDao;
    private final OrderDao orderDao;
    private final UserDao userDao;
    private final HomePageDataDao homePageDataDao;
    private final LoginInfoDao loginInfoDao;

    public DaoSession(SQLiteDatabase db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        noteDaoConfig = daoConfigMap.get(NoteDao.class).clone();
        noteDaoConfig.initIdentityScope(type);

        customerDaoConfig = daoConfigMap.get(CustomerDao.class).clone();
        customerDaoConfig.initIdentityScope(type);

        orderDaoConfig = daoConfigMap.get(OrderDao.class).clone();
        orderDaoConfig.initIdentityScope(type);

        userDaoConfig = daoConfigMap.get(UserDao.class).clone();
        userDaoConfig.initIdentityScope(type);

        homePageDataDaoConfig = daoConfigMap.get(HomePageDataDao.class).clone();
        homePageDataDaoConfig.initIdentityScope(type);

        loginInfoDaoConfig = daoConfigMap.get(LoginInfoDao.class).clone();
        loginInfoDaoConfig.initIdentityScope(type);

        noteDao = new NoteDao(noteDaoConfig, this);
        customerDao = new CustomerDao(customerDaoConfig, this);
        orderDao = new OrderDao(orderDaoConfig, this);
        userDao = new UserDao(userDaoConfig, this);
        homePageDataDao = new HomePageDataDao(homePageDataDaoConfig, this);
        loginInfoDao = new LoginInfoDao(loginInfoDaoConfig, this);

        registerDao(Note.class, noteDao);
        registerDao(Customer.class, customerDao);
        registerDao(Order.class, orderDao);
        registerDao(User.class, userDao);
        registerDao(HomePageData.class, homePageDataDao);
        registerDao(LoginInfo.class, loginInfoDao);
    }
    
    public void clear() {
        noteDaoConfig.getIdentityScope().clear();
        customerDaoConfig.getIdentityScope().clear();
        orderDaoConfig.getIdentityScope().clear();
        userDaoConfig.getIdentityScope().clear();
        homePageDataDaoConfig.getIdentityScope().clear();
        loginInfoDaoConfig.getIdentityScope().clear();
    }

    public NoteDao getNoteDao() {
        return noteDao;
    }

    public CustomerDao getCustomerDao() {
        return customerDao;
    }

    public OrderDao getOrderDao() {
        return orderDao;
    }

    public UserDao getUserDao() {
        return userDao;
    }

    public HomePageDataDao getHomePageDataDao() {
        return homePageDataDao;
    }

    public LoginInfoDao getLoginInfoDao() {
        return loginInfoDao;
    }

}
